﻿using System;
using Newtonsoft.Json;

namespace ZilLion.TaskManager.Entity.Entity
{
    public class TaskStateDto
    {
        [JsonProperty("taskConfig")]
        public TaskConfig TaskConfig { get; set; }

        [JsonProperty("taskState")]
        public TaskStateEntity TaskState { get; set; }

        [JsonProperty("nodeInfo")]
        public NodeInfoEntity NodeInfo { get; set; }
    }

    [Serializable]
    public class TaskStateEntity
    {
        [JsonProperty("nodeId")]
        public string NodeId { get; set; }

        [JsonProperty("taskid")]
        public string Taskid { get; set; }

        /// <summary>
        ///     作业执行状态 0-运行中，1-停止
        /// </summary>
        [JsonProperty("taskstatus")]
        public short Taskstatus { get; set; }

        /// <summary>
        ///     预计下次运行时间
        /// </summary>
        [JsonProperty("tasknextruntime")]
        public DateTime Tasknextruntime { get; set; } = DateTime.Now;

        /// <summary>
        ///     最后运行时间
        /// </summary>
        [JsonProperty("tasklastruntime")]
        public DateTime Tasklastruntime { get; set; } = DateTime.Now;
    }
}